package com.crm.quartz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.crm.repository.UserCheckRepository;
import com.crm.service.impl.UserServiceImpl;

@Component
@EnableScheduling
public class QuartzUserCheck {

	@Autowired
	private UserServiceImpl userService;
	
	@Autowired
	private UserCheckRepository ucRepository;
	 @Scheduled(cron="0 59 19 ? * * ") //每天19:59分执行重置签到状态
	public void reSetCheckState() {
		userService.reSetCheckState();//重置用户表中的签到状态
		ucRepository.reSetUser_CheckState();//将签到记录表中签到但未签退的状态在定时中强制签退
	}
}
